import * as types from './mutation-types'
import { setLocalStorage, getLocalStorage } from '../api/util.js'

const mutations = {
  [types.SET_TOKEN](state, token) {
    state.token = token
    localStorage['__token'] = token
  },
  [types.SET_EXPIRE](state, expire) {
    state.expire = expire
    localStorage['__expire'] = expire
  },
  [types.SET_LOGINGO](state, url) {
    state.loginGo = url
    localStorage['__loginGo'] = url
  },
  [types.SET_ACCOUNTDATA](state, data) {
    state.accountData = data
  },
}

export default mutations
